package com.bdy.lm.taximanager.model;

import android.content.Context;
import android.graphics.Bitmap;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class DriverInfo {

    private static DriverInfo driverInfo;
    private String CIDValidTimeBegin;
    private String CIDValidTimeEnd;
    private String CertificationID;
    private String CertificationOrg;
    private String Education;
    private String ICID = "195996CE";
    private String IndustryID;
    private String PhoneNum;
    private String driverCompany = "福州市**出租车公司";
    private String driverIDnum;
    private String driverName = "张三";
    private Bitmap driverPhoto = null;
    private String driverSex;
    private String inTime = "8:18:18";
    private String outTime;
    private String areaId="01";
    private List<Map<String, String>> msgList = new ArrayList<Map<String, String>>();

    public List<Map<String, String>> getMsgList() {
        return msgList;
    }

    /**
     * 将新加入的元素放到集合的最前面
     * @param msg
     */
    public void setMsgList(Map<String, String> msg) {
        msgList.add(msg);
        if(msgList.size() > 1){
            for (int i = msgList.size(); i > 1; i--) {
                msgList.set(i - 1, msgList.get(i - 2));
            }
            msgList.set(0, msg);
        }
    }

    public static DriverInfo getDriverInfo() {
        if (driverInfo == null)
            driverInfo = new DriverInfo();
        return driverInfo;
    }

    public DriverInfo() {
    }

    public String getICID() {
        return ICID;
    }

    public void setICID(String ICID) {
        this.ICID = ICID;
    }

    public String getDriverCompany() {
        return driverCompany;
    }

    public void setDriverCompany(String driverCompany) {
        this.driverCompany = driverCompany;
    }

    public String getDriverName() {
        return driverName;
    }

    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    public Bitmap getDriverPhoto() {
        return driverPhoto;
    }

    public void setDriverPhoto(Bitmap driverPhoto) {
        this.driverPhoto = driverPhoto;
    }

    public String getInTime() {
        return inTime;
    }

    public void setInTime(String inTime) {
        this.inTime = inTime;
    }

    public String getAreaId() {
        return areaId;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }

    public static void resetFields() {
        driverInfo = null;
    }
}
